<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8" />
		<title>慧尔家</title>
		<!--<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">-->
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
		<script type="text/javascript" src="/pages/js/jquery.min.js" ></script>
		<script type="text/javascript" src="/pages/js/amazeui.min.js"></script>
		<script type="text/javascript" src="/pages/js/layer.js"></script>

		<link rel="stylesheet" href="/pages/css/amazeui.min.css" type="text/css" />
		<link rel="stylesheet" href="/pages/css/style.css" type="text/css" />
	</head>
	<body>
		 <header data-am-widget="header" class="am-header am-header-default jz">
		      <div class="am-header-left am-header-nav">
		         <a href="javascript:history.back()" class="">
					<i class="am-icon-chevron-left"></i>
				</a>
		      </div>
		      <h1 class="am-header-title">人员注册</h1>
        </header>
        <ul class="near">

        	<li th:each="list:${fcFacePics}">
				<div class="pic"><img th:src="@{'/faceImage/'+${list.picUrl}(newId = ${list.id})}"> </div>
        	   <div class="text">
        	    	<h2><i></i><span th:text="${list.name}"></span></h2>
        	    	<p>
						类型：
						<span th:if="${list.type} eq 0">业主</span>
						<span th:if="${list.type} eq 1">家属</span>
						<span th:if="${list.type} eq 2">访客</span>
					</p>
        	    	<p>
						备注：
						<span th:text="${list.desc}"></span>
					</p>
        	   </div>
        	   <button type="button" class="ture" th:onclick="'javascript:delPic('+this+','+${list.id}+');'">删除</button>
				<!--th:onClick="'javaScript:admin_del('+this+','+${recodes.uid}+');'"-->
			</li>

        </ul>
        <a href="/user/addface.html"> <button class="login-btn" type="button">注册新人员</button></a>
        <div style="height: 49px;"></div>

		 <div data-am-widget="navbar" class="am-navbar  gm-foot am-no-layout" id="">
			 <ul class="am-navbar-nav am-cf am-avg-sm-4">
				 <li class="curr">
					 <a href="/user/index.html" class="curr">
						 <span class="am-icon-home"></span>
						 <span class="am-navbar-label">首页</span>
					 </a>
				 </li>
				 <li>
					 <a href="/user/alarmrecord.html" class="">
						 <span class="am-icon-th-large"></span>
						 <span class="am-navbar-label">记录</span>
					 </a>
				 </li>
				 <li>
					 <a href="/user/member.html" class="">
						 <span class="am-icon-user"></span>
						 <span class="am-navbar-label">我的</span>
					 </a>
				 </li>

			 </ul>
		 </div>

		 <script>
             //删除图片
             function delPic(obj,e){
                 //alert(e);
                 layer.open({
                     content: '确认删除该图片吗？',
                     btn: ['确认', '取消'],
                     shadeClose: false, //默认：true，是否点击遮罩时关闭层
                     yes: function() {

						 var loading = layer.open({
							 type: 2,
							 shadeClose: false,
							 content: '正在加载'
						 });

                         $.post("/userDo/delPic.do", { "imgId": e },function(data){
                             if(data.code==200){

								 //关闭加载动画
								 layer.close(loading);
								 //移除被删除的数据
								 $(obj).parents("li").remove();
								 //弹出成功提示
								 layer.open({
									 content: '删除图片成功！',
									 time: 3,
									 btn: ['我知道了']
								 });
                             }else {
								//关闭加载动画
                             	layer.close(loading);
								 //弹出错误提示
                                 layer.open({
                                     content: data.msg+"code:"+data.code,
                                     time: 3,
									 btn: ['我知道了']
                                 });
                             }
                         }, "json").error(function (xhr,status,info) {
							 //console.log(xhr.status);
							 //console.log('错误信息：'+info);
							 //关闭加载动画
							 layer.close(loading);
							 layer.open({
								 content: '网络异常,请稍后再试!',
								 time: 3,
							     btn: ['我知道了']
							 });
						 });
                     },
                     no: function() {
                         layer.open({
                             content: '已取消',
                             time: 1
                         });
                     }
                 });
                // window.location.href="/userDo/delPic.do?imgId="+e;
             }
		 </script>


	</body>


</html>
